<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>涨幅添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <form action="" method="post" class="form form-horizontal" id="form-admin-role-add" onsubmit="return false">
            <div class="form-group">
                <label class="col-sm-3 control-label">时间：</label>
                <div class="col-sm-8">
                    <input id="time" name="time" value="{$data.time}"  class="form-control" type="text"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">品种：</label>
                <div class="col-sm-8">
                    <input id="symbol" name="rate" value="{$data.symbol}"  class="form-control" type="text"  datatype="*" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">代码：</label>
                <div class="col-sm-8">
                    <input id="code" name="rate" value="{$data.code}"  class="form-control" type="text"  datatype="*" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">品种类型：</label>
                <div class="col-sm-8">
                    <select name="type" id="type" class="input-sm form-control input-s-sm inline">
                        <option value="1" <if condition="$data.type eq 1">selected="selected"</if>>数字产品</option>
                        <option value="2" <if condition="$data.type eq 2">selected="selected"</if>>外汇产品</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">涨幅：</label>
                <div class="col-sm-8">
                    <input id="rose" name="rose" value="{$data.rose}" class="form-control" type="text"  datatype="*4-16" nullmsg="不能为空">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">涨/跌：</label>
                <div class="col-sm-8">
                    <select name="type" id="status" class="input-sm form-control input-s-sm inline">
                        <option value="1" <if condition="$data.status eq 1">selected="selected"</if>>跌</option>
                        <option value="2" <if condition="$data.status eq 2">selected="selected"</if>>涨</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上线状态：</label>
                <div class="col-sm-8">
                    <select name="type" id="online" class="input-sm form-control input-s-sm inline">
                        <option value="1" <if condition="$data.online eq 1">selected="selected"</if>>已上线</option>
                        <option value="2" <if condition="$data.online neq 1">selected="selected"</if>>未上线</option>
                    </select>
                </div>
            </div>

            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <button type="button" class="btn btn-success radius"  onclick="Rose_save()" id="admin-role-save" name="admin-role-save">
                        <i class="icon-ok"></i> 确定
                    </button>

                    <a style="margin-left: 20px;" href="position.html" class="btn btn-success btn-warning">
                        <i class="icon-ok"></i> 返回
                    </a>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Peity -->
<script>

    function Rose_save() {
        var time= $("#time").val();
        var symbol= $("#symbol").val();
        var code = $("#code").val();
        var type= $("#type").val();
        var rose= $("#rose").val();
        var status = $("#status").val();
        var online = $("#online").val();
        if(time=='' || symbol==''||code==''||type=='' || rose==''||status==''||online==''){
            layer.msg('请填全部信息');
        }else {
            $.post('__MODULE__/Index/Rose_saveData',{id:'{$data.id}',time:time,symbol:symbol,code:code,type:type,rose:rose,status:status,online:online},function (data) {
                if(data.status==1){
                    layer.msg(data.msg);
                    setTimeout(function(){location.reload();},1000);
                }else if(data.status==0){
                    layer.msg(data.error);
                }else{
                    layer.msg('网络错误');
                }
            })
        }
    }
</script>
</body>
</html>
